bonsoon's blog |
| latest | about | random
# AM, GM, and the AGM. In this article we discuss the **arithmetic-geometric mean** of two positive numbers $x,y > 0$, denote as $\operatorname{agm} (x,y)$, and show that we have an integral form $$ \operatorname{agm}(x,y) = \frac{\pi}{2} \left( \int_{0}^{\pi / 2} \frac{dt}{\sqrt{x^{2}\cos^{2} + y^{2}\sin^{2}(t)}} \right)^{-1} $$ ## Arithmetic mean, geometric mean, and the arithmetic-geometric mean. Given any two non-negative reals $x,y$, define their *arithmetic mean* to be $$ a(x,y) = \frac{1}{2} (x+y) $$and their *geometric mean* to be $$ g(x,y) = \sqrt{xy}. $$ It is well-known that we have > **AM-GM inequality.** >For any two non-negative reals $x,y \ge 0$, we have inequality $$ \min(x,y) \le g(x,y) \le a(x,y) \le \max(x,y). $$ $\blacktriangleright$ Indeed, $\min(x,y)^{2} \le xy$ and $x + y \le 2 \max(x,y)$ for $x,y \ge 0$. And note that $$ \begin{align*} (x-y)^{2} & \ge 0 \\ \implies x^{2} - 2xy + y^{2} & \ge 0 \\ \implies x^{2} + 2xy + y^{2} & \ge 4xy \\ \implies (x+y)^{2} & \ge 4xy \\ \implies a(x,y) & \ge g(x,y). \quad\blacksquare \end{align*} $$ Now, take any $x,y > 0$, define a pair of sequences $(x_{n})$ and $(y_{n})$ where $x_{0} = x$, $y_{0}= y$ and $$ \begin{align*} x_{n+1} &= a(x_{n},y_{n}) = \frac{1}{2}(x_{n}+y_{n}) \\ y_{n+1} &= g(x_{n},y_{n}) = \sqrt{x_{n}y_{n}} \end{align*} $$for all $n\ge 0$. That is, we repeatedly take the arithmetic mean and the geometric mean of the two previous terms. We claim the following: > For any $x,y > 0$, both sequences $(x_{n})$ and $(y_{n})$ converges, and in fact they converge to the same limit $\mu = \lim x_{n} = \lim y_{n}$. $\blacktriangleright$ Let $(x_{n})$ and $(y_{n})$ be sequences defined as above. First we show both sequences converges, then we show their limits are the same. Note after one iterate, $x_{1} = a(x,y)$ and $y_{1} = g(x,y)$, we have $y_{1} \le x_{1}$ by AM-GM inequality. And again by AM-GM inequality, we have $$ \min(x,y) \le y_{n} \le y_{n+1} \le x_{n+1} \le x_{n} \le \max(x,y) $$for all $n\ge 1$. So $(x_{n})$ is a decreasing sequence bounded below by $y_{1}$, while $(y_{n})$ is an increasing sequence bounded above by $x_{1}$. Hence by monotone sequence theorem, the limits $\lim x_{n}$ and $\lim y_{n}$ both exist. Now we show $\lim x_{n} = \lim y_{n}$. Let us denote $\delta_{n} = |x_{n}-y_{n}|$. Note that $x_{2},y_{2} \in [y_{1},x_{1}]$ and that $x_{2}$ is the midpoint of $x_{1}$ and $y_{1}$. Hence $\delta_{2}:= |y_{2} - x_{2}| \le \frac{\delta_{1}}{2}$. And in general $$ \delta_{n} = |x_{n} - y_{n}| \le \frac{1}{2^{n}} |x_{0}-y_{0}|.$$So $$ \lim |x_{n} - y_{n} | = 0, $$ whence $\lim x_{n} = \lim y_{n} = \mu$, some $\mu$. $\blacksquare$ This gives a well-defined notion of the *arithmetic-geometric mean* of two non-negative reals: > **The arithmetic-geometric mean of two non-negative reals.** For any $x,y \ge 0$, define their arithmetic-geometric mean as $\operatorname{agm}(x,y) = \mu$, where $\mu$ is the common limit of the repeated arithmetic and geometric mean sequences $(x_{n})$ and $(y_{n})$ as defined above. Note if one of $x$ or $y$ equal zero, then $\operatorname{agm}(x,y) = 0$. By the proofs in this construction, we see that for any two non-negative reals where $x,y \ge 0$, we have > $$ \min(x,y) \le g(x,y) \le \operatorname{agm} (x,y) \le a(x,y) \le \max(x,y). $$ For example, consider $x = x_{0} = 1$ and $y =y_{0}= 2$, if we compute their iterated arithmetic means and geometric means, we get a table, for all $n\ge 1$, $$ \begin{array}{c|c|c} n & x_{n} = a(x_{n-1},y_{n-1}) & y_{n} = g(x_{n-1},y_{n-1})\\ \hline 0& 1 & 2 \\ 1& 1.5 & \sqrt{2} =1.41421356237 \\ 2& 1.4571067811865475 & 1.4564753151219703 \\ 3 & 1.4567910481542587 & 1.456791013939555\\ 4& 1.4567910310469068 & 1.4567910310469068 \end{array} $$so $\operatorname{agm}(1,2) \approx 1.4567910310469068...$. Note this converges quite rapidly, as the difference $|x_{n}-y_{n}|$ decreases by a factor of 2 in each iteration. Some basic properties of $\operatorname{agm}(x,y)$. For any $x, y \ge 0$, we have - $\operatorname{agm}(x,y) = \operatorname{agm}(y,x)$ - $\operatorname{agm}(x,y) = \operatorname{agm}(a(x,y),g(x,y))$ - $\operatorname{agm}(x,0) = 0$ - $\operatorname{agm}(\lambda x,\lambda y)=\lambda \operatorname{agm}(x,y)$, for $\lambda \ge 0$. - $\operatorname{agm}(u,u) = u$, for all $u \ge 0$. Note, by the homogeneity of $\operatorname{agm}(x,y)$, we can consider the function $$ f(x) = \operatorname{agm}(x,1). $$ What is the asymptotic of $f(x)=\operatorname{agm}(x,1)$? As it turns out, we have $$ \operatorname{agm}(x,1) \sim \frac{2}{\pi} \frac{x}{\log(x)}, \text{ as } x\to\infty. $$ (Connection to prime number theorem?? Note if we denote $\pi(x)$ as the number of primes less than or equal to $x$, then $\pi(x) \sim x / \log x$ as well.) ## Integral form of the AGM. Is it possible to find a closed form for $\operatorname{agm}(x,y)$? In fact Gauss found an integral form! > **Gauss integral form for the AGM.** > For any two positive reals $x,y > 0$ we have $$ \operatorname{agm} (x,y) = \frac{\pi / 2 }{\displaystyle \int_{0}^{\pi / 2} \frac{dt}{\sqrt{x^{2} \cos^{2}(t) + y^{2}\sin^{2}(t)}}} $$ Astounding! In fact, at age 22 Gauss observed purely computationally, verified to 11 decimal places by hand, that $$ \frac{1}{\operatorname{agm} (1,\sqrt{2})} = \frac{2}{\pi} \int_{0}^{1} \frac{dt}{\sqrt{1-t^{4}}}, $$which he wrote in his diary, that if this fact is true, then it shall lead to new development in analysis. This value $\operatorname{agm}(1,\sqrt{2}) \approx 1.1981402347355923$, also known as *Gauss constant*, converges quite quickly. Denote this integral $$ J(x,y) = \int_{0}^{\pi/2} \frac{dt}{\sqrt{x^{2}\cos^{2}(t)+y^{2}\sin^{2}(t)}}. $$The strategy is to show that $$ J\left( \frac{x+y}{2}, \sqrt{xy} \right) = J(x,y). $$ How Gauss establish the integral identity is to take a suitable substitution, but it isn't immediate to see how to come about this choice of substitution. We will instead re-express the integral to be something more symmetric, by applying Lagrange's identity to better determine what to substitute. Ok. Let us lay out our overall task. Denote for $x,y > 0$ the integral $$ J(x,y) = \int_{0}^{\pi/2} \frac{dt}{\sqrt{x^{2}\cos^{2}(t)+y^{2}\sin^{2}(t)}}, $$and we wish to show that $$ \operatorname{agm} (x,y) J(x,y) = \frac{\pi}{2}. $$ First we re-express $J(x,y)$ into something more symmetric. By factoring, we see that $$ J(x,y) = \int_{0}^{\pi/2} \frac{dt}{x\cos(t) \sqrt{1+\left( \frac{y}{x} \right)^{2}\tan^{2}(t)}} $$which suggests the substitution $$ u = \frac{y}{x} \tan(t) $$so $$ \arctan(x u / y) = t,\quad dt= \frac{(x / y) du}{1+(x u /y)^{2}} $$Note as $t$ ranges from $0$ to $\pi / 2$, we have $u$ ranging from $0$ to $+\infty$. Also for $t\in [0, \frac{\pi}{2}]$, we have $\cos(t),\sin(t),\tan(t) \ge 0$, so $$ 1 + \tan^{2}(t) = \frac{1}{\cos^{2}(t)} $$and $$ \cos(t) = \frac{1}{\sqrt{1+\tan^{2}(t)}} = \frac{1}{\sqrt{1+(x u / y)^{2}}}. $$ With these substitutions, we have now $$ \begin{align*} J(x,y) & = \int_{u=0}^{\infty} \frac{(x / y) du}{(1 + (x u / y)^{2})} \frac{\sqrt{1 + (x u / y)^{2}}}{x \sqrt{1 + u^{2}}} \\ & = \int_{u=0}^{\infty} \frac{(1 / y) du}{\sqrt{1+ (x u / y)^{2}}\sqrt{1 + u^{2}}} \\ & = \int_{u = 0}^{\infty} \frac{du}{\sqrt{y^{2} + x^{2}u^{2}}\sqrt{1+u^{2}}} \end{align*} $$ If we employ another simple substitution $w = xu$, $dw = x du$, then $$ \begin{align*} J(x,y) & = \int_{w=0}^{\infty} \frac{dw}{x \sqrt{y^{2} +w^{2}} \sqrt{1+(w / x)^{2}}} \\ &= \int_{w=0}^{\infty} \frac{dw}{\sqrt{y^{2} +w^{2}} \sqrt{x^{2}+w^{2}}} \end{align*} $$ So after relabeling, we establish the identity > For $x, y > 0$, we have $$ J(x,y) = \int_0^{\pi / 2} \frac{dt}{\sqrt{x^{2}\cos^{2}(t)+y^{2}\sin^{2}(t)}} = \int_{0}^{\infty} \frac{dt}{\sqrt{(x^{2}+t^{2})(y^{2}+t^{2})}} $$ In other words, $J(x,y)$ is an **elliptic integral**. By modern definition, an elliptic integral is an integral of the form $$ \int R\left (t,\sqrt{P(t)} \right) dt $$where $R(t,u)$ is a rational function in $t,u$, and $P$ is a polynomial of degree 3 or 4, typically without repeated roots. Next, using this equivalent elliptic integral form of $J(x,y)$, we will show $$ J\left( \frac{x+y}{2} , \sqrt{xy}\right) = J(x,y). $$Note we have $$ J\left( \frac{x+y}{2}, \sqrt{xy} \right) = \int_{0}^{\infty} \frac{dt}{\sqrt{\left(\frac{x+y}{2}\right)^{2}+t^{2}}\sqrt{ xy+t^{2}}} $$ To do this we recall **Lagrange's identity**, where $$ (A^{2} +B^{2})(C^{2}+D^{2}) = (AC + BD)^{2} + (AD - BC)^{2}. $$There are two ways to apply Lagrange's identity to the radicand in $J(x,y)$, one way leads to $$ (x^{2}+t^{2})(y^{2}+t^{2}) = (xt + yt)^{2}+(xy-t^{2})^{2} = (x+y)^{2}t^{2} + (xy-t^{2})^{2} $$which looks promising as we have terms like $(x+y)$ and $xy$. With this, we have $$ \begin{align*} J(x,y) & = \int_{0}^{\infty} \frac{dt}{\sqrt{(x+y)^{2}t^{2}+(xy-t^{2})^{2}}} \\ & = \int_{0}^{\infty} \frac{dt}{t\sqrt{(x+y)^{2}+\left( \frac{xy}{t} - t \right)^{2}}} \end{align*} $$ This prompts the substitution $$ u = t - \frac{xy}{t} , \quad du = \left( 1 + \frac{xy}{t^{2}} \right) dt = \left( t + \frac{xy}{t} \right) \frac{dt}{t} $$And note when $t$ ranges from $0$ to $\infty$, we have $u$ range from $-\infty$ to $+\infty$. So $$ J(x,y) = \int_{u = -\infty}^{+\infty} \frac{du}{\left( t+\frac{xy}{t} \right)\sqrt{(x+y)^{2}+u^{2}}} $$To express $t + \frac{xy}{t}$ in terms of $u$, we solve for $t$ in terms of $u$. Since $u = t - \frac{xy}{t}$, we have $$ tu = t^{2}-xy \implies t = \frac{u \pm \sqrt{u^{2}+4xy}}{2} $$But since $t \ge 0$, we must have the $+$ sign in expression above. So $$ \begin{align*} t + \frac{xy}{t}&= \frac{u}{2}+\frac{\sqrt{u^{2}+4xy}}{2} + \frac{2xy}{u+\sqrt{u^{2}+4xy}} \\ &= \frac{u}{2} + \frac{\sqrt{u^{2}+4xy}}{2} + \frac{2xy(u-\sqrt{u^{2}+4xy})}{u^{2}-(u^{2}+4xy)} \\ &= \frac{u}{2} + \frac{\sqrt{u^{2}+4xy}}{2} - \frac{u}{2} + \frac{\sqrt{u^{2}+4xy}}{2} \\ \implies t + \frac{xy}{t}&= \sqrt{u^{2}+4xy} \end{align*} $$Hence $$ \begin{align*} J(x,y) & = \int_{-\infty}^{\infty} \frac{du}{\sqrt{u^{2}+4xy}\sqrt{(x+y)^{2}+u^{2}}} \\ & = 2 \int_{0}^{\infty} \frac{du}{\sqrt{u^{2}+4xy}\sqrt{(x+y)^{2}+u^{2}}} \end{align*} $$as the integrand is an even function in $u$. Finally, by setting $2 w = u$, $2dw = du$, we have $$ \begin{align*} J(x,y) &= 2 \int_{0}^{\infty} \frac{2dw}{\sqrt{4w^{2}+4xy}\sqrt{(x+y)^{2}+4w^{2}}} \\ & = \int_{0}^{\infty} \frac{dw}{\sqrt{w^{2}+xy} \sqrt{\left( \frac{x+y}{2} \right)^{2}+w^{2}}} \\ \implies J(x,y) &= J\left( \frac{x+y}{2} , \sqrt{xy}\right) \end{align*} $$as claimed! Finally, we establish the claim of $J(x,y)$ with $\operatorname{agm}(x,y)$. Take any $x,y> 0$, and set $x_{0} = x$, $y_{0} = y$, and $$ x_{n+1} = \frac{x_{n}+y_{n}}{2}, y_{n+1} = \sqrt{x_{n}y_{n}} $$we have $$ J(x,y) = J(x_{n},y_{n}) $$for all $n\ge 0$. Now, convince ourselves that $J(x,y)$ is continuous for $x,y > 0$, so as $\lim x_{n} = \lim y_{n} = \mu = \operatorname{agm}M(x,y)$, we have $$ J(x,y) = J(x_{n}, y_{n}) = \lim J(x_{n},y_{n}) = J(\mu,\mu) $$where $\mu = \operatorname{agm}(x,y)$. And since $$ J(\mu,\mu) = \int_0^{\pi / 2} \frac{dt}{\sqrt{\mu^{2}\cos^{2}(t)+\mu^{2}\sin^{2}(t)}} = \frac{\pi}{2\mu}, $$we see that $$ J(x,y) = \frac{\pi}{2 \operatorname{agm} (x,y)} $$as claimed! $\blacksquare$